package com.ddm.service.impl;

import com.ddm.mapper.ProjectMapper;
import com.entity.Project;
import com.ddm.service.IProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by he on 2025/3/4 13:34
 */
@Service
public class ProjectServiceImpl implements IProjectService {
    // 注入ProjectMapper
    @Autowired
    private ProjectMapper projectMapper;
    // 根据项目ID查询
    @Override
    public Project selectProjectById(Integer projectId) {
        return projectMapper.selectProjectById(projectId);
    }

    // 根据项目名称查询
    @Override
    public Project selectProjectByName(String projectName) {
        return projectMapper.selectProjectByName(projectName);
    }

    // 查询所有项目
    @Override
    public List<Project> listAllProjects() {
        return projectMapper.listAllProjects();
    }

    // 查询项目列表
    @Override
    public List<Project> selectProjectList(Project project) {
        return projectMapper.selectProjectList(project);
    }

    // 新增项目
    @Override
    public int insertProject(Project project) {
        return projectMapper.insertProject(project);
    }

    // 修改项目信息
    @Override
    public int updateProject(Project project) {
        return projectMapper.updateProject(project);
    }

    // 根据项目ID删除
    @Override
    public int deleteProjectById(Integer projectId) {
        return projectMapper.deleteProjectById(projectId);
    }
    // 批量删除项目
    @Override
    public int deleteProjectByIds(Integer[] projectIds) {
        return projectMapper.deleteProjectByIds(projectIds);
    }
}
